<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="java.util.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><fmt:message key="wrProcessList.title"/></title>
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
<script src="<c:url value='/scripts/common.js'/>"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0

}
//-->
</script>
</head>

<body leftmargin="0" topmargin="0">
<form name="processInstanceForm" action='queryActsForProc.do?processInstanceId=' method="post">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="44" class="home-content-title"><img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle">流程执行情况监控台</td>
  </tr>
  <tr>
    <td valign="top"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content">
                		<c:if test="${wrProcess.curstate=='0'}">
                          <input name="button" type="button" class="home-inputBtn" onClick="MM_openBrWindow('./ProcessPicture?procInstId=<c:out value="${processInstanceId}"/>',null,'top=100,height=600,width=900,status=no,resizable=yes,toolbar=no,menubar=no,location=no scrollbars=yes')" value="查看流程图">
						</c:if>
						<c:if test="${wrProcess.curstate=='1'}">
                          <input name="button" type="button" class="home-inputBtn" onClick="MM_openBrWindow('./ProcessPicture?isProcessClosed=true&procInstId=<c:out value="${processInstanceId}"/>',null,'top=100,height=600,width=900,status=no,resizable=yes,toolbar=no,menubar=no,location=no scrollbars=yes')" value="查看流程图">
						</c:if>

			<input name="button" type="button" class="home-inputBtn" onClick="history.go(-1)" value="返回">
            </td>
              </tr>
              <tr>
                <td align="center" valign="top">&nbsp;</td>
              </tr>
              <tr> 
                <td valign="top" class="home-edittable-space">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td>
						<table width="100%" border="0" cellpadding="4" cellspacing="1" class="home-subtable-bgcolor">
						
							<tr> 
								<td class="home-subtable-view-tdstyle-right">当前状态：</td>
								<td colspan=3 class="home-subtable-view-tdstyle-left"><c:out value="${wrProcess.flowStatus}"/></td>
							</tr>
							<tr> 
								<td class="home-subtable-view-tdstyle-right">发起人： </td>
								<td class="home-subtable-view-tdstyle-left"><c:out value="${wrProcess.startperformer}"/></td>
								<td class="home-subtable-view-tdstyle-right">创建时间：</td>
								<td class="home-subtable-view-tdstyle-left">
								<script> 
									var dateTimeR="<c:out value="${wrProcess.createtime}"/>";
									dateTimeR=dateTimeR.substring(0,16);
									document.write(dateTimeR) 
					            </script>
								</td>
							</tr>
                        </table>
					   </td>
                    </tr>



					<tr> 
					   <td valign="top" class="home-tab-line"> 
						<table width="100%" border="0" cellspacing="1" cellpadding="2" class="home-subtable-bgcolor">
							<tr>
								<td width="5%"  class="home-table-tool-conten">任务名称</td>
								<td width="12%" class="home-table-tool-conten">执行人</td>
								<td width="12%" class="home-table-tool-conten">联系电话</td>
								<td width="5%"  class="home-table-tool-conten">接收时间</td>
								<!-- 
								<td width="10%" class="home-table-tool-conten">创建时间</td> -->
								<td width="10%" class="home-table-tool-conten">状态</td>
							</tr>
							<c:forEach var="results" items="${processMonitorList}" varStatus="status">
							<tr>
								<td class="home-tab-content">&nbsp;<c:out value="${results.name}"/></td>
								<td class="home-tab-content">&nbsp;<c:out value="${results.participant}"/></td>
								<td class="home-tab-content">&nbsp;<c:out value="${results.phone}"/></td>
								<td class="home-tab-content">&nbsp;<fmt:formatDate value="${results.receivetime}" pattern="yyyy-MM-dd HH:mm"/></td>
								<!--  
								<td class="home-tab-content">&nbsp;<c:out value="${results.createtime}"/></td> -->
								<td class="home-tab-content">&nbsp;<c:out value="${results.curstate}"/></td>
							</tr>
							</c:forEach>
						 </table>
					   </td>
                    </tr>
                   <c:if test="${wrProcess.curstate!='1'}">
                    <tr> 
                      <td  class="home-tab-line">
						<table width="100%" border="0" cellpadding="4" cellspacing="1" class="home-subtable-bgcolor">
							<tr>
								<td align="center" >&nbsp; 
									<a href='workflowmonitor.html?method=changeProcessState&model=<c:out value="${model}"/>&id=<c:out value="${processInstanceId}"/>&act=open.not_running.suspended'>挂起</a>&nbsp;&nbsp;
									<a href='workflowmonitor.html?method=changeProcessState&model=<c:out value="${model}"/>&id=<c:out value="${processInstanceId}"/>&act=open.running'>恢复</a>&nbsp;&nbsp;
									<a href='workflowmonitor.html?method=changeProcessState&model=<c:out value="${model}"/>&id=<c:out value="${processInstanceId}"/>&act=closed.terminated'>终止</a>&nbsp;&nbsp;
									<a href='workflowmonitor.html?method=changeProcessState&model=<c:out value="${model}"/>&id=<c:out value="${processInstanceId}"/>&act=closed.aborted'>取消</a>&nbsp;&nbsp;
								</td>
							</tr>
						</table>
					   </td>
                    </tr>
                  </c:if>
				  </table> 
                </td>
              </tr>
            </table>
		  </td>
        </tr>

        <tr> 
          <td height="12">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table>
			</td>
        </tr>
      </table>
	  
	  </td>
  </tr>
  <tr>
    <td height="10">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>
<script language="JavaScript">
<!--
//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
    var image=new Image();
    image.src=ImgD.src;
    if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
        ImgD.width=iwidth;
        ImgD.height=(image.height*iwidth)/image.width;
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    else{
        if(image.height>iheight){  
        ImgD.height=iheight;
        ImgD.width=(image.width*iheight)/image.height;        
        }else{
        ImgD.width=image.width;  
        ImgD.height=image.height;
        }
        ImgD.alt=image.width+"×"+image.height;
        }
    }
} 
//-->

</script>

 